package com.hotel.service.Impl;

import com.hotel.dao.FoodDao;
import com.hotel.dao.FoodTypeDao;
import com.hotel.dao.OrderDetailDao;
import com.hotel.factory.BeanFactory;
import com.hotel.pojo.Food;
import com.hotel.service.FoodService;
import com.hotel.utils.PageBean;
import org.apache.commons.beanutils.BeanUtils;

import java.util.Iterator;
import java.util.List;
import java.util.Map;

/**
 * Created by LinYaTing on 2018/11/25 22:27
 */
public class FoodServiceImpl implements FoodService {

    private FoodDao foodDao = BeanFactory.getInstance("foodDao", FoodDao.class);

    @Override
    public List<Map<String, Object>> findAll() {
        return foodDao.findAll();
    }

    @Override
    public List<Map<String, Object>>findFoodByKeyWord(String keyWord) {
        return foodDao.findFoodByKeyWord(keyWord);
    }

    @Override
    public Map<String, Object> findFoodById(int id) {
        return foodDao.findFoodById(id);
    }

    @Override
    public void save(Food food) {
        foodDao.save(food);
    }

    @Override
    public void update(Food food) {
        foodDao.update(food);
    }

    @Override
    public void delete(int id) {
        foodDao.delete(id);
    }

    @Override
    public void getAll(PageBean<Food> pb) {
        foodDao.getAll(pb);
    }
}
